Setting the tab order for controls

 

When your program runs, the user can navigate through each control using the Tab key.
You can set the tab order for each control capable of receiving focus so as to create a
structured path for the user to follow.


To set a controls position in the tab order, change the controls tabindex property to an
integer number designating its placement in the order. The Windows tab order runs from
0 (first) to n (last).

Tip: Start with the last control on your form and set its tabindex property to 0. Click on
the next to last control. The properties window should now be waiting for the tabindex of
that control. Set it to 0. Each time you assign a control a tabindex of 0 (or any number)
Visual Basic automatically increments (renumbers) those controls with an assigned
tabindex greater than or equal to the index entered. So the last control would be
renumbered to tabindex 1

 

Default property Of A Control:

 

Every control has a default property, which is usually the most used propert y of that
control. For instance, the default property of the label control is the .caption property, for
the text box it is the .text property, and for the image control it is the .picture property.
This means that you don't have to type out the full control name and property for each
control. The following pair lines of code have identical effects.


textbox.text = "text"
textbox = "text"


label.caption = "caption"
label = "caption"


image.picture = LoadPicture(picture.bmp)
image = LoadPicture(picture.bmp)

 

 

 

visual basic controls by p. muthulakshmi & v. vanthana